using System;
using System.Windows.Forms;
using System.Xml.Serialization;

namespace App.Modelo.Menu
{
    /// <summary>
    /// Modelo abstracto de un Item del menu xml
    /// </summary>
    public abstract class MenuBaseItem
    {
        [XmlAttribute("image")]
        public string Image { get; set; }

        [XmlAttribute("text")]
        public string Text { get; set; }

        [XmlAttribute("command")]
        public string Command { get; set; }

        public bool ComprobarPermiso { get; set; }

        private string type;
        public virtual string Type
        {
            get { return String.IsNullOrEmpty(type) ? "MenuItem" : type; }
            set { type = value; }
        }

        [XmlIgnore]
        public ToolStripItem Control { get; set; }

        public MenuBaseItem()
        {
            ComprobarPermiso = true;
        }
    }
}